# Copyright (c) 2018 Presto Labs Pte. Ltd.
# Author: inkyu

from coin.exchange.base.kr_rest.product_info import ProductInfo, ProductHolder
from coin.exchange.bitfinex_v2.kr_rest.product import BitfinexProduct
from coin.exchange.base.tick import BitfinexTickPrice


def get_holder_from_product(product):
  assert isinstance(product, BitfinexProduct)
  product_info = bitfinex_v2_symbol_map[product.native_symbol]
  return ProductHolder(product, product_info)


def _gen_product_info(min_qty, max_qty):
  return ProductInfo(tick_price_cls=BitfinexTickPrice,
                     qty_precision=8,
                     min_qty=min_qty,
                     max_qty=max_qty)


bitfinex_v2_symbol_map = {
    'tAGIBTC': _gen_product_info(312.000000, 200000.000000),
    'tAGIETH': _gen_product_info(312.000000, 200000.000000),
    'tAGIUSD': _gen_product_info(312.000000, 200000.000000),
    'tAIDBTC': _gen_product_info(484.000000, 200000.000000),
    'tAIDETH': _gen_product_info(484.000000, 200000.000000),
    'tAIDUSD': _gen_product_info(484.000000, 200000.000000),
    'tAIOBTC': _gen_product_info(74.000000, 20000.000000),
    'tAIOETH': _gen_product_info(74.000000, 20000.000000),
    'tAIOUSD': _gen_product_info(74.000000, 20000.000000),
    'tANTBTC': _gen_product_info(36.000000, 10000.000000),
    'tANTETH': _gen_product_info(36.000000, 10000.000000),
    'tANTUSD': _gen_product_info(36.000000, 10000.000000),
    'tAUCBTC': _gen_product_info(400.000000, 150000.000000),
    'tAUCETH': _gen_product_info(400.000000, 150000.000000),
    'tAUCUSD': _gen_product_info(400.000000, 150000.000000),
    'tAVTBTC': _gen_product_info(46.000000, 50000.000000),
    'tAVTETH': _gen_product_info(46.000000, 50000.000000),
    'tAVTUSD': _gen_product_info(46.000000, 50000.000000),
    'tBATBTC': _gen_product_info(72.000000, 200000.000000),
    'tBATETH': _gen_product_info(72.000000, 200000.000000),
    'tBATUSD': _gen_product_info(72.000000, 200000.000000),
    'tBABBTC': _gen_product_info(0.060000, 500.000000),
    'tBABUSD': _gen_product_info(0.060000, 500.000000),
    'tBSVBTC': _gen_product_info(0.200000, 5000.000000),
    'tBSVUSD': _gen_product_info(0.200000, 5000.000000),
    'tBCIBTC': _gen_product_info(26.000000, 5000.000000),
    'tBCIUSD': _gen_product_info(26.000000, 5000.000000),
    'tBFTBTC': _gen_product_info(488.000000, 200000.000000),
    'tBFTETH': _gen_product_info(488.000000, 200000.000000),
    'tBFTUSD': _gen_product_info(488.000000, 200000.000000),
    'tBTCEUR': _gen_product_info(0.002000, 2000.000000),
    'tBTCGBP': _gen_product_info(0.002000, 2000.000000),
    'tBTCJPY': _gen_product_info(0.002000, 2000.000000),
    'tBTCUSD': _gen_product_info(0.002000, 2000.000000),
    'tBTGBTC': _gen_product_info(0.600000, 2000.000000),
    'tBTGUSD': _gen_product_info(0.600000, 2000.000000),
    'tCBTBTC': _gen_product_info(1228.000000, 1000000.000000),
    'tCBTETH': _gen_product_info(1228.000000, 1000000.000000),
    'tCBTUSD': _gen_product_info(1228.000000, 1000000.000000),
    'tCFIBTC': _gen_product_info(566.000000, 40000.000000),
    'tCFIETH': _gen_product_info(566.000000, 40000.000000),
    'tCFIUSD': _gen_product_info(566.000000, 40000.000000),
    'tCNDBTC': _gen_product_info(792.000000, 100000.000000),
    'tCNDETH': _gen_product_info(792.000000, 100000.000000),
    'tCNDUSD': _gen_product_info(792.000000, 100000.000000),
    'tCTXBTC': _gen_product_info(72.000000, 50000.000000),
    'tCTXETH': _gen_product_info(72.000000, 50000.000000),
    'tCTXUSD': _gen_product_info(72.000000, 50000.000000),
    'tDADBTC': _gen_product_info(226.000000, 200000.000000),
    'tDADETH': _gen_product_info(226.000000, 200000.000000),
    'tDADUSD': _gen_product_info(226.000000, 200000.000000),
    'tDAIBTC': _gen_product_info(10.000000, 20000.000000),
    'tDAIETH': _gen_product_info(10.000000, 20000.000000),
    'tDAIUSD': _gen_product_info(10.000000, 20000.000000),
    'tDATBTC': _gen_product_info(598.000000, 250000.000000),
    'tDATETH': _gen_product_info(598.000000, 250000.000000),
    'tDATUSD': _gen_product_info(598.000000, 250000.000000),
    'tDSHBTC': _gen_product_info(0.200000, 5000.000000),
    'tDSHUSD': _gen_product_info(0.200000, 5000.000000),
    'tDTHBTC': _gen_product_info(1148.000000, 100000.000000),
    'tDTHETH': _gen_product_info(1148.000000, 100000.000000),
    'tDTHUSD': _gen_product_info(1148.000000, 100000.000000),
    'tEDOBTC': _gen_product_info(16.000000, 50000.000000),
    'tEDOETH': _gen_product_info(16.000000, 50000.000000),
    'tEDOUSD': _gen_product_info(16.000000, 50000.000000),
    'tELFBTC': _gen_product_info(90.000000, 75000.000000),
    'tELFETH': _gen_product_info(90.000000, 75000.000000),
    'tELFUSD': _gen_product_info(90.000000, 75000.000000),
    'tEOSBTC': _gen_product_info(4.000000, 50000.000000),
    'tEOSETH': _gen_product_info(4.000000, 50000.000000),
    'tEOSEUR': _gen_product_info(4.000000, 50000.000000),
    'tEOSGBP': _gen_product_info(4.000000, 50000.000000),
    'tEOSJPY': _gen_product_info(4.000000, 50000.000000),
    'tEOSUSD': _gen_product_info(4.000000, 50000.000000),
    'tETCBTC': _gen_product_info(2.000000, 100000.000000),
    'tETCUSD': _gen_product_info(2.000000, 100000.000000),
    'tETHBTC': _gen_product_info(0.100000, 5000.000000),
    'tETHEUR': _gen_product_info(0.100000, 5000.000000),
    'tETHGBP': _gen_product_info(0.100000, 5000.000000),
    'tETHJPY': _gen_product_info(0.100000, 5000.000000),
    'tETHUSD': _gen_product_info(0.100000, 5000.000000),
    'tETPBTC': _gen_product_info(10.000000, 10000.000000),
    'tETPETH': _gen_product_info(10.000000, 10000.000000),
    'tETPUSD': _gen_product_info(10.000000, 10000.000000),
    'tFSNBTC': _gen_product_info(14.000000, 10000.000000),
    'tFSNETH': _gen_product_info(14.000000, 10000.000000),
    'tFSNUSD': _gen_product_info(14.000000, 10000.000000),
    'tFUNBTC': _gen_product_info(2380.000000, 200000.000000),
    'tFUNETH': _gen_product_info(2380.000000, 200000.000000),
    'tFUNUSD': _gen_product_info(2380.000000, 200000.000000),
    'tGNTBTC': _gen_product_info(126.000000, 200000.000000),
    'tGNTETH': _gen_product_info(126.000000, 200000.000000),
    'tGNTUSD': _gen_product_info(126.000000, 200000.000000),
    'tIOSBTC': _gen_product_info(2220.000000, 200000.000000),
    'tIOSETH': _gen_product_info(2220.000000, 200000.000000),
    'tIOSUSD': _gen_product_info(2220.000000, 200000.000000),
    'tIOTBTC': _gen_product_info(36.000000, 100000.000000),
    'tIOTETH': _gen_product_info(36.000000, 100000.000000),
    'tIOTEUR': _gen_product_info(36.000000, 100000.000000),
    'tIOTGBP': _gen_product_info(36.000000, 100000.000000),
    'tIOTJPY': _gen_product_info(36.000000, 100000.000000),
    'tIOTUSD': _gen_product_info(36.000000, 100000.000000),
    'tIQXBTC': _gen_product_info(3194.000000, 100000.000000),
    'tIQXUSD': _gen_product_info(3194.000000, 100000.000000),
    'tKNCBTC': _gen_product_info(60.000000, 20000.000000),
    'tKNCETH': _gen_product_info(60.000000, 20000.000000),
    'tKNCUSD': _gen_product_info(60.000000, 20000.000000),
    'tLRCBTC': _gen_product_info(226.000000, 50000.000000),
    'tLRCETH': _gen_product_info(226.000000, 50000.000000),
    'tLRCUSD': _gen_product_info(226.000000, 50000.000000),
    'tLTCBTC': _gen_product_info(0.400000, 5000.000000),
    'tLTCUSD': _gen_product_info(0.400000, 5000.000000),
    'tLYMBTC': _gen_product_info(1408.000000, 400000.000000),
    'tLYMETH': _gen_product_info(1408.000000, 400000.000000),
    'tLYMUSD': _gen_product_info(1408.000000, 400000.000000),
    'tMITBTC': _gen_product_info(102.000000, 30000.000000),
    'tMITETH': _gen_product_info(102.000000, 30000.000000),
    'tMITUSD': _gen_product_info(102.000000, 30000.000000),
    'tMKRBTC': _gen_product_info(0.040000, 50.000000),
    'tMKRETH': _gen_product_info(0.040000, 50.000000),
    'tMKRUSD': _gen_product_info(0.040000, 50.000000),
    'tMNABTC': _gen_product_info(188.000000, 200000.000000),
    'tMNAETH': _gen_product_info(188.000000, 200000.000000),
    'tMNAUSD': _gen_product_info(188.000000, 200000.000000),
    'tMTNBTC': _gen_product_info(1126.000000, 200000.000000),
    'tMTNETH': _gen_product_info(1126.000000, 200000.000000),
    'tMTNUSD': _gen_product_info(1126.000000, 200000.000000),
    'tNCABTC': _gen_product_info(4348.000000, 200000.000000),
    'tNCAETH': _gen_product_info(4348.000000, 200000.000000),
    'tNCAUSD': _gen_product_info(4348.000000, 200000.000000),
    'tNEOBTC': _gen_product_info(2.000000, 10000.000000),
    'tNEOETH': _gen_product_info(2.000000, 10000.000000),
    'tNEOEUR': _gen_product_info(2.000000, 10000.000000),
    'tNEOGBP': _gen_product_info(2.000000, 10000.000000),
    'tNEOJPY': _gen_product_info(2.000000, 10000.000000),
    'tNEOUSD': _gen_product_info(2.000000, 10000.000000),
    'tODEBTC': _gen_product_info(86.000000, 200000.000000),
    'tODEETH': _gen_product_info(86.000000, 200000.000000),
    'tODEUSD': _gen_product_info(86.000000, 200000.000000),
    'tOMGBTC': _gen_product_info(6.000000, 100000.000000),
    'tOMGETH': _gen_product_info(6.000000, 100000.000000),
    'tOMGUSD': _gen_product_info(6.000000, 100000.000000),
    'tORSBTC': _gen_product_info(476.000000, 500000.000000),
    'tORSETH': _gen_product_info(476.000000, 500000.000000),
    'tORSUSD': _gen_product_info(476.000000, 500000.000000),
    'tPOABTC': _gen_product_info(190.000000, 150000.000000),
    'tPOAETH': _gen_product_info(190.000000, 150000.000000),
    'tPOAUSD': _gen_product_info(190.000000, 150000.000000),
    'tPOYBTC': _gen_product_info(70.000000, 100000.000000),
    'tPOYETH': _gen_product_info(70.000000, 100000.000000),
    'tPOYUSD': _gen_product_info(70.000000, 100000.000000),
    'tQSHBTC': _gen_product_info(68.000000, 50000.000000),
    'tQSHETH': _gen_product_info(68.000000, 50000.000000),
    'tQSHUSD': _gen_product_info(68.000000, 50000.000000),
    'tQTMBTC': _gen_product_info(6.000000, 2000.000000),
    'tQTMETH': _gen_product_info(6.000000, 2000.000000),
    'tQTMUSD': _gen_product_info(6.000000, 2000.000000),
    'tRCNBTC': _gen_product_info(738.000000, 200000.000000),
    'tRCNETH': _gen_product_info(738.000000, 200000.000000),
    'tRCNUSD': _gen_product_info(738.000000, 200000.000000),
    'tRDNBTC': _gen_product_info(32.000000, 20000.000000),
    'tRDNETH': _gen_product_info(32.000000, 20000.000000),
    'tRDNUSD': _gen_product_info(32.000000, 20000.000000),
    'tREPBTC': _gen_product_info(2.000000, 1000.000000),
    'tREPETH': _gen_product_info(2.000000, 1000.000000),
    'tREPUSD': _gen_product_info(2.000000, 1000.000000),
    'tREQBTC': _gen_product_info(354.000000, 100000.000000),
    'tREQETH': _gen_product_info(354.000000, 100000.000000),
    'tREQUSD': _gen_product_info(354.000000, 100000.000000),
    'tRLCBTC': _gen_product_info(54.000000, 25000.000000),
    'tRLCETH': _gen_product_info(54.000000, 25000.000000),
    'tRLCUSD': _gen_product_info(54.000000, 25000.000000),
    'tRRTBTC': _gen_product_info(294.000000, 100000.000000),
    'tRRTUSD': _gen_product_info(294.000000, 100000.000000),
    'tSANBTC': _gen_product_info(44.000000, 200000.000000),
    'tSANETH': _gen_product_info(44.000000, 200000.000000),
    'tSANUSD': _gen_product_info(44.000000, 200000.000000),
    'tSENBTC': _gen_product_info(5438.000000, 200000.000000),
    'tSENETH': _gen_product_info(5438.000000, 200000.000000),
    'tSENUSD': _gen_product_info(5438.000000, 200000.000000),
    'tSNGBTC': _gen_product_info(758.000000, 200000.000000),
    'tSNGETH': _gen_product_info(758.000000, 200000.000000),
    'tSNGUSD': _gen_product_info(758.000000, 200000.000000),
    'tSNTBTC': _gen_product_info(556.000000, 200000.000000),
    'tSNTETH': _gen_product_info(556.000000, 200000.000000),
    'tSNTUSD': _gen_product_info(556.000000, 200000.000000),
    'tSPKBTC': _gen_product_info(472.000000, 200000.000000),
    'tSPKETH': _gen_product_info(472.000000, 200000.000000),
    'tSPKUSD': _gen_product_info(472.000000, 200000.000000),
    'tSTJBTC': _gen_product_info(62.000000, 30000.000000),
    'tSTJETH': _gen_product_info(62.000000, 30000.000000),
    'tSTJUSD': _gen_product_info(62.000000, 30000.000000),
    'tTNBBTC': _gen_product_info(2470.000000, 200000.000000),
    'tTNBETH': _gen_product_info(2470.000000, 200000.000000),
    'tTNBUSD': _gen_product_info(2470.000000, 200000.000000),
    'tTRXBTC': _gen_product_info(838.000000, 1000000.000000),
    'tTRXETH': _gen_product_info(838.000000, 1000000.000000),
    'tTRXEUR': _gen_product_info(838.000000, 1000000.000000),
    'tTRXGBP': _gen_product_info(838.000000, 1000000.000000),
    'tTRXJPY': _gen_product_info(838.000000, 1000000.000000),
    'tTRXUSD': _gen_product_info(838.000000, 1000000.000000),
    'tUTKBTC': _gen_product_info(464.000000, 300000.000000),
    'tUTKETH': _gen_product_info(464.000000, 300000.000000),
    'tUTKUSD': _gen_product_info(464.000000, 300000.000000),
    'tVEEBTC': _gen_product_info(2218.000000, 800000.000000),
    'tVEEETH': _gen_product_info(2218.000000, 800000.000000),
    'tVEEUSD': _gen_product_info(2218.000000, 800000.000000),
    'tWAXBTC': _gen_product_info(170.000000, 50000.000000),
    'tWAXETH': _gen_product_info(170.000000, 50000.000000),
    'tWAXUSD': _gen_product_info(170.000000, 50000.000000),
    'tXLMBTC': _gen_product_info(68.000000, 100000.000000),
    'tXLMETH': _gen_product_info(68.000000, 100000.000000),
    'tXLMEUR': _gen_product_info(68.000000, 100000.000000),
    'tXLMGBP': _gen_product_info(68.000000, 100000.000000),
    'tXLMJPY': _gen_product_info(68.000000, 100000.000000),
    'tXLMUSD': _gen_product_info(68.000000, 100000.000000),
    'tXMRBTC': _gen_product_info(0.200000, 5000.000000),
    'tXMRUSD': _gen_product_info(0.200000, 5000.000000),
    'tXRPBTC': _gen_product_info(38.000000, 200000.000000),
    'tXRPUSD': _gen_product_info(38.000000, 200000.000000),
    'tXVGBTC': _gen_product_info(1764.000000, 1500000.000000),
    'tXVGETH': _gen_product_info(1764.000000, 1500000.000000),
    'tXVGEUR': _gen_product_info(1764.000000, 500000.000000),
    'tXVGGBP': _gen_product_info(1764.000000, 1500000.000000),
    'tXVGJPY': _gen_product_info(1764.000000, 1500000.000000),
    'tXVGUSD': _gen_product_info(1764.000000, 1500000.000000),
    'tYYWBTC': _gen_product_info(620.000000, 50000.000000),
    'tYYWETH': _gen_product_info(620.000000, 50000.000000),
    'tYYWUSD': _gen_product_info(620.000000, 50000.000000),
    'tZCNBTC': _gen_product_info(90.000000, 50000.000000),
    'tZCNETH': _gen_product_info(90.000000, 50000.000000),
    'tZCNUSD': _gen_product_info(90.000000, 50000.000000),
    'tZECBTC': _gen_product_info(0.200000, 20000.000000),
    'tZECUSD': _gen_product_info(0.200000, 20000.000000),
    'tZRXBTC': _gen_product_info(28.000000, 200000.000000),
    'tZRXETH': _gen_product_info(28.000000, 200000.000000),
    'tZRXUSD': _gen_product_info(28.000000, 200000.000000),
}
